function main() {
    
    setTimeout(res => {
        debugger
        let self = this;
        let treeEle = self.$$("tree_panel_9omiww");

        // treeEle.params.is_law_department = '1';
        let unitName = api.USER_INFO().departmentName;
        unitName = '明镜司法';
        const params = [{
            name: "unitName",
            valueContent: unitName
        }];
        let is_law_department = '';
        getApiValue(params)
            .then(res => {
                console.log(res);
                is_law_department = res.result.is_law_department;
                treeEle.params.is_law_department = '1';
                treeEle.doQuery();
            })
            .catch(error => {
                console.error("获取API值时出错:", error);
            });
    },500)
   

}

function getApiValue(params) {
    return new Promise((resolve, reject) => {
        api.DATA_SOURCE_EXECUTE("85530457-bdfb-40b3-ad1f-7b15750fd513", "api", params, [], "")
            .then(res => {
                try {
                    const resValue = JSON.parse(res.result);
                    console.log(resValue);
                    resolve(resValue);
                } catch (parseError) {
                    console.error("解析API响应时出错:", parseError);
                    reject(parseError);
                }
            })
            .catch(apiError => {
                console.error("调用API时出错:", apiError);
                reject(apiError);
            });
    });
}
